from redis import Redis
from typing import Union,Awaitable
import json

class MyRedis(Redis):
    def hgetall(self, name: str) -> Union[Awaitable[dict], dict]:
        data = super().hgetall(name)
        return {k.decode(): json.loads(v.decode()) for k, v in data.items()}
my_cache = MyRedis(db=5)


